package com.atguigu.srb.sms.util;

import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component
@Data
@ConfigurationProperties(prefix = "aliyun.sms")
public class SmsProperties implements InitializingBean {
    private String regionId;// cn-shenzhen #cn-hangzhou
    private String keyId; // LTAI5t6U6EZC4RRpCtsMBYjr  #你的keyid
    private String keySecret;// UsVolC8vsyVbcHZ4t0S1byixm4LIw5  # 你的keysecret
    private String templateCode; // SMS_217425770 # 你的短信模板code
    private String signName; // 北京课时教育  # 你的短信模板签名

    public static String REGIONID;
    public static String KEYID;
    public static String KEYSECRET;
    public static String TEMPLATECODE;
    public static String SIGNNAME;

    @Override
    public void afterPropertiesSet() throws Exception {
        REGIONID = regionId;
        KEYID = keyId;
        KEYSECRET = keySecret;
        TEMPLATECODE = templateCode;
        SIGNNAME = signName;

    }
}
